package zhouzhouyongche.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import zhouzhouyongche.model.Seat;

@Repository
public class SeatDao extends HibernateDao<Seat>{

	public List<Seat> querySeat(int ticketId) {
		String hql = "select t.seats "
				   + "from Ticket as t "
				   + "where t.id = ?";
		Query q = getCurrentSession().createQuery(hql);
		q.setInteger(0, ticketId);
		return q.list();
	}
	
}
